#ifndef PONG_GAMEOBJ_H
#define PONG_GAMEOBJ_H

#include <OgreFrameListener.h>


namespace Ogre {
    class SceneNode;
}

class btRigidBody;

namespace pong {
	class Core;

	/** A basic game object. Has physics and a SceneNode, 
	 *  syncrhonizes the scenenode with the physics state
	 *  automagically **/
	class GameObject : public Ogre::FrameListener {
		protected:
			Core& core;
			Ogre::SceneNode* renderNode; //Graphic OGRE Node
			btRigidBody*     body;

		public:
			GameObject(Core&, Ogre::SceneNode* const, btRigidBody* const);
			virtual ~GameObject(void);

			// Accessor for the Ogre::SceneNode
			inline const Ogre::SceneNode* renderingNode(void) const {
                return renderNode;
            }

			inline const btRigidBody* rigidBody(void) const {return body;}

			virtual bool frameStarted(const Ogre::FrameEvent&);

        protected:
            void setRigidBody(btRigidBody* const rb) {body = rb;}
	};
}
#endif //PONG_GAMEOBJ_H
